#ifndef FRAMETIMER_H
#define FRAMETIMER_H

#pragma once

#include <LDF/LargeDisplayFrameworkLayer.h>
#include <queue>

/**
 * This abstract class (which is implemented at the Toolkit layer) 
 * provides the interface for calculating the frame rate when rendering components 
 * in the UofC Large Display Framework. The timing API (which is platform specific) 
 * and the logic for calculating frame rate is implmented by subclasses.
 *
 * This class was devised from the frame rate calculation mechanism used in the
 * TabletopVis class of the original implementation of the framework by
 * A. Miede and T. Isenberg in the Interactions Lab at the University of
 * Calgary, Canada.
 *
 * @author Fabricio Anastacio - fabriciocfa@yahoo.com
 * @since July 26, 2007
 */
class LARGEDISPLAYFRAMEWORKLAYER_API FrameTimer
{
	// Methods
public:
	/**
	 * Constructs this frame timer object.
	 */
	FrameTimer();
	
	/**
	 * Destroys this frame timer object.
	 */
	virtual ~FrameTimer(void);

	/**
	 * Starts measuring an interval.
	 */
	virtual void start() = 0;
	/**
	 * Ends measuring an interval.
	 */
	virtual void end() = 0;

	/**
	 * Calculates the frame per seconds value based on what unit is used to
	 * measure the system time in the used platform (e.g., msecs, clock ticks,
	 * etc.).
	 *
	 * @return the fps value.
	 */
	virtual double calculateFrameRate() = 0;
};

#endif // FRAMETIMER_H
